// JavaScript Document
//================================1======================================
	function add_new_MAILLIST(){
		var vtmpMAILLIST = document.getElementById('tmpMAILLIST').value;	
		var vMAILLIST = document.getElementById('MAILLIST').value;
		var MAILLIST_arr = vMAILLIST.split(';');
		var stringMAILLIST='';
		var num=0;
		for(i in MAILLIST_arr){
			if (MAILLIST_arr[i]==vtmpMAILLIST){
				num=1;
				break;
			}
		}
		if(num==0){
			stringMAILLIST = vtmpMAILLIST;
			document.getElementById('MAILLIST').value = document.getElementById('MAILLIST').value + stringMAILLIST +";";
		}
	}
	
	function delete_MAILLIST(){
		var i;
		var num=0;
		var vtmpMAILLIST = document.getElementById('tmpMAILLIST').value;
		var vMAILLIST = document.getElementById('MAILLIST').value;
		var MAILLIST_arr = vMAILLIST.split(';');
		if(vtmpMAILLIST==''){
			return false;
		}
		if(vMAILLIST.replace(';','')==vtmpMAILLIST){
			document.getElementById('MAILLIST').value='';
			num=1;
		}
		if(num==0){
			for(i in MAILLIST_arr){
				if(MAILLIST_arr[i]==vtmpMAILLIST){	
					vMAILLIST = vMAILLIST.replace(vtmpMAILLIST+';','');
				}
			}
			document.getElementById('MAILLIST').value = vMAILLIST;
		}
	}
//=====================================2=================================
	function add_new_HOPOS(){
		var vtmpHOPOS = document.getElementById('tmpHOPOS').value;	
		var vHOPOS = document.getElementById('HOPOS').value;
		var HOPOS_arr = vHOPOS.split(';');
		var stringHOPOS='';
		var num=0;
		for(i in HOPOS_arr){
			if (HOPOS_arr[i]==vtmpHOPOS){
				num=1;
				break;
			}
		}
		if(num==0){
			stringHOPOS = vtmpHOPOS;
			document.getElementById('HOPOS').value = document.getElementById('HOPOS').value + stringHOPOS +";";
		}
	}
	
	function delete_HOPOS(){
		var i;
		var num=0;
		var vtmpHOPOS = document.getElementById('tmpHOPOS').value;
		var vHOPOS = document.getElementById('HOPOS').value;
		var HOPOS_arr = vHOPOS.split(';');
		if(vtmpHOPOS==''){
			return false;
		}
		if(vHOPOS.replace(';','')==vtmpHOPOS){
			document.getElementById('HOPOS').value='';
			num=1;
		}
		if(num==0){
			for(i in HOPOS_arr){
				if(HOPOS_arr[i]==vtmpHOPOS){	
					vHOPOS = vHOPOS.replace(vtmpHOPOS+';','');
				}
			}
			document.getElementById('HOPOS').value = vHOPOS;
		}
	}
//==================================3=====================================
	function add_new_ZONPOS(){
		var vtmpZONPOS = document.getElementById('tmpZONPOS').value;	
		var vZONPOS = document.getElementById('ZONPOS').value;
		var ZONPOS_arr = vZONPOS.split(';');
		var stringZONPOS='';
		var num=0;
		for(i in ZONPOS_arr){
			if (ZONPOS_arr[i]==vtmpZONPOS){
				num=1;
				break;
			}
		}
		if(num==0){
			stringZONPOS = vtmpZONPOS;
			document.getElementById('ZONPOS').value = document.getElementById('ZONPOS').value + stringZONPOS +";";
		}
	}
	
	function delete_ZONPOS(){
		var i;
		var num=0;
		var vtmpZONPOS = document.getElementById('tmpZONPOS').value;
		var vZONPOS = document.getElementById('ZONPOS').value;
		var ZONPOS_arr = vZONPOS.split(';');
		if(vtmpZONPOS==''){
			return false;
		}
		if(vZONPOS.replace(';','')==vtmpZONPOS){
			document.getElementById('ZONPOS').value='';
			num=1;
		}
		if(num==0){
			for(i in ZONPOS_arr){
				if(ZONPOS_arr[i]==vtmpZONPOS){	
					vZONPOS = vZONPOS.replace(vtmpZONPOS+';','');
				}
			}
			document.getElementById('ZONPOS').value = vZONPOS;
		}
	}
//==================================4====================================
	function add_new_BRNPOS(){
		var vtmpBRNPOS = document.getElementById('tmpBRNPOS').value;	
		var vBRNPOS = document.getElementById('BRNPOS').value;
		var BRNPOS_arr = vBRNPOS.split(';');
		var stringBRNPOS='';
		var num=0;
		for(i in BRNPOS_arr){
			if (BRNPOS_arr[i]==vtmpBRNPOS){
				num=1;
				break;
			}
		}
		if(num==0){
			stringBRNPOS = vtmpBRNPOS;
			document.getElementById('BRNPOS').value = document.getElementById('BRNPOS').value + stringBRNPOS +";";
		}
	}
	
	function delete_BRNPOS(){
		var i;
		var num=0;
		var vtmpBRNPOS = document.getElementById('tmpBRNPOS').value;
		var vBRNPOS = document.getElementById('BRNPOS').value;
		var BRNPOS_arr = vBRNPOS.split(';');
		if(vtmpBRNPOS==''){
			return false;
		}
		if(vBRNPOS.replace(';','')==vtmpBRNPOS){
			document.getElementById('BRNPOS').value='';
			num=1;
		}
		if(num==0){
			for(i in BRNPOS_arr){
				if(BRNPOS_arr[i]==vtmpBRNPOS){	
					vBRNPOS = vBRNPOS.replace(vtmpBRNPOS+';','');
				}
			}
			document.getElementById('BRNPOS').value = vBRNPOS;
		}
	}
//=======================================5==============================
	function add_new_DEPTPOS(){
		var vtmpDEPTPOS = document.getElementById('tmpDEPTPOS').value;	
		var vDEPTPOS = document.getElementById('DEPTPOS').value;
		var DEPTPOS_arr = vDEPTPOS.split(';');
		var stringDEPTPOS='';
		var num=0;
		for(i in DEPTPOS_arr){
			if (DEPTPOS_arr[i]==vtmpDEPTPOS){
				num=1;
				break;
			}
		}
		if(num==0){
			stringDEPTPOS = vtmpDEPTPOS;
			document.getElementById('DEPTPOS').value = document.getElementById('DEPTPOS').value + stringDEPTPOS +";";
		}
	}
	
	function delete_DEPTPOS(){
		var i;
		var num=0;
		var vtmpDEPTPOS = document.getElementById('tmpDEPTPOS').value;
		var vDEPTPOS = document.getElementById('DEPTPOS').value;
		var DEPTPOS_arr = vDEPTPOS.split(';');
		if(vtmpDEPTPOS==''){
			return false;
		}
		if(vDEPTPOS.replace(';','')==vtmpDEPTPOS){
			document.getElementById('DEPTPOS').value='';
			num=1;
		}
		if(num==0){
			for(i in DEPTPOS_arr){
				if(DEPTPOS_arr[i]==vtmpDEPTPOS){	
					vDEPTPOS = vDEPTPOS.replace(vtmpDEPTPOS+';','');
				}
			}
			document.getElementById('DEPTPOS').value = vDEPTPOS;
		}
	}